import { ref } from 'vue'
import type { CreditCycleData } from '../types'
import { useChartData } from './useChartData'

export function useCreditCycleData() {
  const { generateCycleData } = useChartData()
  
  const mockConfig = {
    startDate: '2007-07-02',
    endDate: '2023-06-30',
    dataPoints: 200
  }

  const creditCycleData = ref<CreditCycleData>({
    interbankLiquidity: {
      name: '银行间流动性',
      data: generateCycleData(mockConfig),
      color: '#3B82F6'
    },
    interbankLiquidityTrend: {
      name: '银行间流动性-趋势项',
      data: generateCycleData(mockConfig),
      color: '#F59E0B'
    },
    cycleIndicator: {
      name: 'cycle indicato',
      data: generateCycleData(mockConfig),
      color: '#3B82F6'
    },
    creditImpulse: {
      name: '信贷脉冲',
      data: generateCycleData(mockConfig),
      color: '#F59E0B'
    },
    creditChange: {
      name: '信贷变化',
      data: generateCycleData(mockConfig),
      color: '#10B981'
    }
  })

  return {
    creditCycleData
  }
}
